Configuring NixOS

After I was able to dual boot into NixOS/Plasma, I needed to configure it.

Scaling the display

The default scaling on my 1,920 by 1,200 screen was too small to be legible. I set and applied Scale as 150% in System Settings > Display & Monitor > Display Configuration. This was also reflected on the lock screen but not the initial log-in screen.

Configuration file

NixOS is principally configured by the contents of the file /etc/nixos/configuration.nix. When the file is changed, the changes are applied by commanding sudo nixos-rebuild switch.

The file contains a function, which takes an attribute set containing at least config and pkgs as an argument and yields another attribute set:

pkgs is determined by sudo nix-channel --list, being:

That, itself, can be updated with sudo nix-channel --update. The configuration does not change unless it is rebuilt.

One part of the latter attribute set is environment.systemPackages. I initially equated that to:

efibootmgr was added to diagnose duplicate ‘Linux Boot Manager’ entries. xdg-utils was added because one of the tools it provides is used by the Haskell package open-browser.

Terminal

Konsole was already available as a terminal. I created a default profile Default and set its appearance to use Colour scheme Solarised and Font Fira Code 12pt. That font was configured by:

Fira Code provides programming ligatures, but Konsole does not allow the fine-grained configuration that, say, Windows Terminal provides.

Browser

Some packages can be added as attributes of the packages attribute. firefox is an example, and was already configured:

Git

Git is also an attribute of the packages attribute:

Editor

I wanted to use Visual Studio (VS) Code. It is also an attribute of the packages attribute. I tried:

where defaultEditor sets the EDITOR environment variable. However, that appeared to disable the ability to install VS Code extensions in the normal way. So, I reverted to adding pkgs.vscode to the list of environment.systemPackages

I set some others in configuration.nix:

I was not sure about the NixOS approach to VS Code extensions. However, I installed within VS Code in the normal way:

and set (within VS Code) "haskell.manageHLS": "PATH"